function iter = calculateCGIterations3D( H, ErrTol, MaxIts, verbose,n,flag,precision)
    g=zeros(n,n,n,precision);
    W=rand(n,n,n,precision);
    if flag == 0
        L=3*n-2;
        allZeros=zeros(L,L,L,precision);
        %H is the filter's kernel
        Hhat=fftn(H.filter,[L,L,L]);
        [~,~,~,iter] = ConjugateGradient3D(W,Hhat,n,allZeros,ErrTol,MaxIts,g,verbose);
    else
        %note H is a preconditioner, not a filter kernel
        [~,~,~,iter] = ConjugateGradientFeval('diagonalPrecon3DApplication',W,{precision,H,n},ErrTol,MaxIts,g,verbose);
    end
end

